# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=cms-explorer
pkgver=15.23b58cd
pkgrel=5
groups=('blackarch' 'blackarch-fingerprint' 'blackarch-webapp')
pkgdesc='Designed to reveal the specific modules, plugins, components and themes that various cms driven websites are running.'
arch=('any')
url='https://github.com/FlorianHeigl/cms-explorer'
license=('GPL3')
depends=('perl' 'perl-libwhisker2')
makedepends=('git')
#source=('svn+http://cms-explorer.googlecode.com/svn/trunk/')
source=("git+https://github.com/FlorianHeigl/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 755 -t "$pkgdir/usr/share/$pkgname/" *.pl
  install -Dm 644 -t "$pkgdir/usr/share/$pkgname/" *.pm *.txt

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec perl $pkgname.pl "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

